<template>
  <!-- 放人类认证模块 -->

  <div>
    <div>
      <button @click="reset">重置</button>
      <button>关闭</button>
    </div>
    <div id="captcha"></div>
  </div>
</template>

<script setup>
import '../vendor/longbow.slidercaptcha.min.js'
import '../vendor/slidercaptcha.min.css'
import { ref, onMounted } from 'vue'
import { Slider } from 'vant'
let captcha = ref(null)
const reset = () => {
  captcha.reset()
}
onMounted(() => {
  captcha = sliderCaptcha({
    // 这里的id和上面结构的id要相对应
    id: 'captcha',
    onSuccess () {
      console.log('success');
    },
    onFail () {
      console.log('Fail');
    },
    verify () {
      return true
      //  默认的认证行为
    }
  })
})
</script>

<style lang="scss" scoped>
</style>